﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using EventEntrance;

namespace EventEntranceTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod] // test for class DataHelper
        public void TestDataHelper()
        {
            DataHelper dh = new DataHelper();
            Client c = dh.getClient(12345);
            Assert.AreEqual(c.LastName, "Pietraru");
            Assert.AreEqual(c.FirstName, "Andrada");
            int b = dh.changeStatusClient(12345);
            Assert.AreNotEqual(-1, b);
            Client c2 = dh.getClient(111111);
            Assert.AreEqual(c2, null);
        }

        [TestMethod] // test for class Client
        public void TestClient()
        {
            Client c;
            c = new Client(12345, "Johnson", "John", 600, "in");
            Assert.AreEqual(c.Status, "in");
            Assert.AreEqual(c.LastName, "Johnson");
            Assert.AreEqual(c.Balance, 600);
        }

        [TestMethod] // test for class ExitEvent
        public void TestEventEntrance()
        {
            EventEntranceClass ee;
            DataHelper dh = new DataHelper();
            ee = new EventEntranceClass("bla", 12345,dh);
            Client c = ee.getClient(12345);
            Assert.AreEqual(c.ClientId, 12345);
            Assert.AreEqual(c.LastName, "Pietraru");
            bool b = ee.entranceEvent(c);
            Assert.AreEqual(b, true);
            Assert.AreEqual(c.Status, "in");
        }
    }
}
